import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

export const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "Login",
        component: Login => import("@/pages/login/HomeView.vue"),
        meta: {
            title: "登录",
            absolutePath: "/",
        },
    },
    {
        path: "/home",
        name: "Home",
        component: Home => import("@/components/HomeComponent.vue"),
        children: [
            {
                path: "product-category",
                name: "ProductCategory",
                meta:{
                    title: "分类维护",
                    absolutePath: "/home/product-category",
                },
                component: () => import("@/pages/product/category/ProductCategoryView.vue"),
            },
            {
                path: "product-attribute",
                name: "ProductAttribute",
                meta: {
                    title: "属性维护",
                    absolutePath: "/home/product-attribute",
                },
                component: () => import("@/pages/product/attribute/ProductAttributeView.vue"),
            },
            {
                path: "product-attr-group",
                name: "ProductAttrGroup",
                meta: {
                    title: "属性分组",
                    absolutePath: "/home/product-attr-group",
                },
                component: () => import("@/pages/product/attr-group/ProductProductAttrGroupView.vue"),
            },
        ],
    },
];
const router = createRouter({
    history: createWebHistory(),
    routes: routes as RouteRecordRaw[],
});
export default router;